package com.esunny.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.esunny.springboot.pojo.entity.User;


/**
 * <p>
 * 表名全称:t_user  用户表。 Mapper 接口
 * </p>
 *
 * @author 罗滔
 * @since 2020-10-19
 */
public interface UserMapper extends BaseMapper<User> {//注意封装的SQL，没有值的字段不会给默认值的，插入表中会为空，写SQL的会有默认值

    User selectUserByUsername(String username);


    int deleteByPrimaryKey(Long userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Wed Oct 21 19:19:07 CST 2020
     */
    // int insert(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Wed Oct 21 19:19:07 CST 2020
     */
    int insertSelective(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Wed Oct 21 19:19:07 CST 2020
     */
    User selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Wed Oct 21 19:19:07 CST 2020
     */
    int updateByPrimaryKeySelective(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Wed Oct 21 19:19:07 CST 2020
     */
    int updateByPrimaryKey(User record);

    void insertUser(String userName, String password, Long parentId);

    void updatePassword(String userName, String encryptPassword);
}
